package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * null
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_pay_log")
@DynamicInsert
@DynamicUpdate
public class PayLog implements Serializable {

	/**
	 * 订单号
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "order_id")
	private Long orderId;

	/**
	 * 支付金额（分）
	 */
	@Column(name = "total_fee")
	private Long totalFee;

	/**
	 * 用户ID
	 */
	@Column(name = "user_id")
	private Long userId;

	/**
	 * 微信交易号码
	 */
	@Column(name = "transaction_id")
	private String transactionId;

	/**
	 * 交易状态，1 未支付, 2已支付, 3 已退款, 4 支付错误, 5 已关闭
	 */
	@Column(name = "status")
	private Boolean status;

	/**
	 * 支付方式，1 微信支付, 2 货到付款
	 */
	@Column(name = "pay_type")
	private Boolean payType;

	/**
	 * 银行类型
	 */
	@Column(name = "bank_type")
	private String bankType;

	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 * 支付时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "pay_time")
	private java.util.Date payTime;

	/**
	 * 关闭时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "closed_time")
	private java.util.Date closedTime;

	/**
	 * 退款时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "refund_time")
	private java.util.Date refundTime;
}
